//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class EffectStyleItem : IOfficeXmlSerializable
    {
        private EffectProperties effectProperties;

        private Scene3D scene3D;

        private Shape3D shape3D;

        public EffectProperties EffectProperties
        {
            get { return effectProperties; }
            set { effectProperties = value; }
        }

        public Scene3D Scene3D
        {
            get { return scene3D; }
            set { scene3D = value; }
        }

        public Shape3D Shape3D
        {
            get { return shape3D; }
            set { shape3D = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("effectStyle"))
            {
                EffectProperties = EffectProperties.ReadEffectProperties(c);
                Scene3D = c.ReadOptionalElement<Scene3D>(Scene3D.xmlName);
                Shape3D = c.ReadOptionalElement<Shape3D>("sp3d");
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("effectStyle"))
            {
                c.WriteOptionalElement(EffectProperties);
                c.WriteOptionalElement(Scene3D);
                c.WriteOptionalElement(Shape3D);
            }
        }

        #endregion
    }
}